////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_RAY_2_H__
#define __WN_RAY_2_H__

#include "WNCore/inc/WNBase.h"
#include "WNMath/inc/WNPoint2.h"
#include "WNMath/inc/WNVector2.h"

namespace WNMath {
    class WNLine2;
    class WNLine3;

    class WNRay2 {
    public:
        WNRay2();
        explicit WNRay2(const WN_FLOAT32* _f);
        explicit WNRay2(const WNPoint2& _location, const WNVector2& _direction);

        WNRay2 operator + () const;
        WNRay2 operator - () const;

        WN_BOOL operator == (const WNRay2& _ray) const;
        WN_BOOL operator != (const WNRay2& _ray) const;

        WN_VOID Zero();

        WN_BOOL IsZero() const;

        WN_VOID Set(const WN_FLOAT32* _f);
        WN_VOID Set(const WNPoint2& _location, const WNVector2& _direction);

        WNLine2 ToLine2() const;
        WNLine3 ToLine3() const;

    public:
        WNPoint2 location;
        WNVector2 direction;
    };
}

#endif // __WN_RAY_2_H__